--[[ 
    sr501红外设备
 ]]

--==============IMPORT================`
local pilib = require("libs/pilib")
local event =  require("libs/event")
local PIN_MODE = PIN_MODE

--==============IMPORT================`

local sr501 = {}
function sr501.monitor(pinidx)
    pilib.pinMode(pinidx, PIN_MODE["INPUT"])
    while(true)
    do 
        if (pilib.digitalRead(pinidx) == PIN_MODE["HIGH"]) then 
            return true
        end
    end
end 

return sr501



